package com.pinyougou.utis;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()
public class BT {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    long s = 0;
    long e = 0;

    @Before
    public void before() {
        s = System.currentTimeMillis();
    }

    @After
    public void after() {
        e = System.currentTimeMillis();

        logger.info("耗时:{}秒", (e - s) / 1000);
    }

    @Test
    public void ping() {
        logger.info("ok");
    }
}
